import java.io.FileWriter;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;

public class App {

    public static void main(String[] args) {
        try {
            URL url = new URI("http://mrpricegroup.com/m").toURL();
            URLConnection connection = url.openConnection();
            String text = new String(connection.getInputStream().readAllBytes());

            System.out.println(text);

            FileWriter write = new FileWriter("http://mrpricegroup.com/m");
            write.write("{\"state\":\"Ҷумҳурии Тоҷикистон\"");
            write.write("{\"rate\":\"0.687900\"}");
            write.write("{\"rate\":\"1.453834\"}");
            write.flush();
            write.close();
        } catch (IOException | URISyntaxException e) {
            e.printStackTrace();
        }
    }
}
